<html>
<!-- $LastChangedDate: 2009-11-07 22:56:33 -0500 (Sat, 07 Nov 2009) $ -->
<!-- Copyright (C) 2004,2009 Jim Brooks http://www.palomino3d.org -->
<head>
<title>Palomino - Object Module</title>
<link rel='stylesheet' type='text/css' href='docs.css'>
<link rel='icon' type='image/png' href='images/favicon.png'/>
</head>
<body>

<!-- ----------------------------------------------------------------------- -->
<h1>Palomino - Object Module</h1>
<p>
&copy;2004,2009&nbsp;&nbsp;Jim E. Brooks
&nbsp;&nbsp;<a href='http://www.palomino3d.org'>http://www.palomino3d.org</a>
</p>
<hr>
<ul>
  <li><a href='index.html'>Index</a></li>
  <li><a href='#Overview'>Overview</a></li>
  <li><a href='#Object Destruction'>Object Destruction</a></li>
      <ul>
        <li><a href='rules.html#DestroyObject Event'>DestroyObject Event</a></li>
      </ul>
</ul>

<!-- ----------------------------------------------------------------------- -->
<hr>
<a name='Overview'></a>
<h2>Overview</h2>
<p><!--date-->[2008/02]</p>
<p>
This modules has the Object classes (Object/Dyna/Craft)
and auxillary classes (AxisMap,RotationList).
</p>

<h3>Object Derivatives</h3>
<ul>

<li>Object:
<br>The base Object has minimum functionality for a small footprint
to support a multitude of objects.
</li>

<li>Dyna:
<br>Dyna is for "dynamic" objects.
Dyna is derived from Object.
<br>Dyna has a timer-tick method for animation.
</li>

<li>Craft:
Craft is derived from Dyna.
<br>Craft has a throttle, Physics object that moves the Craft, and CraftSpecs
which define a craft's specifications (mass,thrust,etc) used by Physics.
</li>

</ul>

<!-- ----------------------------------------------------------------------- -->
<hr>
<a name='Object Destruction'></a>
<h2>Object Destruction</h2>
<p><!--date-->[2008/11]</p>
<p>
Related states are <i>collided</i>, <i>detached</i>, and <i>crashed</i>,
but those don't necessarily mean the Object has to be deleted from memory.
</p>
<p>
Since Objects are referenced-counted, they cannot be directly deleted.
Rather, Objects are scheduled for deletion by Object::Zombify().
This method will set a zombie flag, then broadcast a
<a href='rules.html#DestroyObject Event'>DestroyObject Event</a>
to release all references to it.
The event is propagated to Lua too
as Lua can hold C++ objects as Lua <i>userdata</i> objects.
</p>
<p>
Of course, there probably will be places in the code
that fail to listen to that event.
As a mitigation to at least reduce memory,
Object::Zombify() will detach from World a zombie's Graph,
and replace it with a minimal Graph.
</p>

<!-- ********************************* END ********************************* -->
<hr>
<p align='center'>
<font size='-2'>
<!-- hhmts start -->
Last modified: Sat Nov  7 14:54:34 CST 2009
<!-- hhmts end -->
</font>
</p>

</body>
</html>
